/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ec.socialfun.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author xavier
 */
@Entity
@Table(name = "formas_de_pago")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FormasDePago.findAll", query = "SELECT f FROM FormasDePago f"),
    @NamedQuery(name = "FormasDePago.findByFpCodigo", query = "SELECT f FROM FormasDePago f WHERE f.fpCodigo = :fpCodigo"),
    @NamedQuery(name = "FormasDePago.findByFpNombre", query = "SELECT f FROM FormasDePago f WHERE f.fpNombre = :fpNombre"),
    @NamedQuery(name = "FormasDePago.findByFpImagen", query = "SELECT f FROM FormasDePago f WHERE f.fpImagen = :fpImagen")})
public class FormasDePago implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "FP_CODIGO")
    private Integer fpCodigo;
    @Basic(optional = false)
    @Column(name = "FP_NOMBRE")
    private String fpNombre;
    @Column(name = "FP_IMAGEN")
    private String fpImagen;
    @Transient
    private boolean existe = false;

    public boolean isExiste() {
        return existe;
    }

    public void setExiste(boolean existe) {
        this.existe = existe;
    }

    public FormasDePago() {
    }

    public FormasDePago(Integer fpCodigo) {
        this.fpCodigo = fpCodigo;
    }

    public FormasDePago(Integer fpCodigo, String fpNombre) {
        this.fpCodigo = fpCodigo;
        this.fpNombre = fpNombre;
    }

    public Integer getFpCodigo() {
        return fpCodigo;
    }

    public void setFpCodigo(Integer fpCodigo) {
        this.fpCodigo = fpCodigo;
    }

    public String getFpNombre() {
        return fpNombre;
    }

    public void setFpNombre(String fpNombre) {
        this.fpNombre = fpNombre;
    }

    public String getFpImagen() {
        return fpImagen;
    }

    public void setFpImagen(String fpImagen) {
        this.fpImagen = fpImagen;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fpCodigo != null ? fpCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FormasDePago)) {
            return false;
        }
        FormasDePago other = (FormasDePago) object;
        if ((this.fpCodigo == null && other.fpCodigo != null) || (this.fpCodigo != null && !this.fpCodigo.equals(other.fpCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ec.socialfun.entidades.FormasDePago[ fpCodigo=" + fpCodigo + " ]";
    }
}
